package com.atguigu.spzx.user.controller;

import com.atguigu.spzx.common.result.Result;
import com.atguigu.spzx.common.result.ResultCodeEnum;
import com.atguigu.spzx.user.entity.UserAddress;
import com.atguigu.spzx.user.service.UserAddressService;
import com.atguigu.spzx.user.vo.UserAddressQueryRespVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * UserAddressController
 * </p>
 *
 * @author flyduck
 * @since 2023/11/6
 */
@Api(tags = "用户地址管理接口")
@RestController
@RequestMapping("/api/user/userAddress")
public class UserAddressController {

    @Autowired
    private UserAddressService userAddressService;

    @ApiOperation("获取用户地址列表")
    @GetMapping("/auth/findUserAddressList")
    public Result<List<UserAddressQueryRespVo>> findUserAddressList() {
        List<UserAddressQueryRespVo> list = userAddressService.findUserAddressList();
        return Result.ok(list);
    }
}
